package com.rpcdemo.rpc.protocol;

import cn.hutool.core.lang.UUID;
import lombok.Data;

import java.io.Serializable;

@Data
public class MyHeader implements Serializable {
    private int flag;
    private long dataLen;
    private long requestID;

    public static MyHeader createHeader(byte[] msg) {
        MyHeader header = new MyHeader();
        header.setDataLen(msg.length);
        header.setRequestID(Math.abs(UUID.fastUUID().getLeastSignificantBits()));
        header.setFlag(0x14141414);
        return header;
    }
}
